package Service.impl;

import Dao.SalaryDao;
import Dao.impl.SalaryDaoImpl;
import Domin.Salary;
import Service.SalaryService;

import java.util.List;

public class SalaryServiceImpl implements SalaryService {
    private final SalaryDao salaryDao = new SalaryDaoImpl();

    @Override
    public boolean issueSalary(int empId, double base, double bonus, String month) {
        Salary s = new Salary(empId, base, bonus, month);
        return salaryDao.saveSalary(s);
    }

    @Override
    public List<Salary> viewMySalary(int empId) {
        return salaryDao.getSalariesByEmpId(empId);
    }

    @Override
    public List<Salary> viewAllSalaries() {
        return salaryDao.getAllSalaries();
    }
}